<?php

class login_Model extends CI_Model {

	function __construct() {
		parent::__construct();
		$this->load->database();
	}

	function login($username, $password) {
		$this->db->select('id, first, last, login, password, email');
		$this->db->from('customer');
		$this->db->where('login', $username);
		$this->db->where('password', $password);
		$this->db->limit(1);

		$query = $this->db->get();
		if($query->num_rows() > 0) {
			return $query->result();
		}
		else {
			return false;
		}
	}
}